import { defineStore } from "pinia";
import { ref } from "vue";
import { https } from "@/api/api";
import { useMarkerStore } from '@/store/index';
const useNotepadStore = defineStore("notepadStore", () => {
  const data = ref<Array<NotepadItem>>([]);
  const markerStore = useMarkerStore();
  const apiNotepadRecord = async () => {
    const res = await https({
      mode: "notepad",
      name: "apiGetFollowUp",
      data: {
        mid: markerStore.marker.mid+'',
      },
    });
    data.value = res.data.list;
  };
  // 删除指定回访记录
  const deleteNotepad=(id:number)=>{
    data.value=data.value.filter(item=>item.fuid!==id);
  }
  return { data, apiNotepadRecord,deleteNotepad };
});
export default useNotepadStore;
